package com.et.launch

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.text.TextUtils

class BootReceiver : BroadcastReceiver() {

    override fun onReceive(context: Context, intent: Intent) {
        if (TextUtils.equals(intent.action, Intent.ACTION_BOOT_COMPLETED)) {
            Intent(context, MainActivity::class.java).also {
                it.flags = Intent.FLAG_ACTIVITY_NEW_TASK
                context.startActivity(it)
            }
        }
    }
}